﻿using UnityEngine;
using System.Collections;

public class QuestionHandler : MonoBehaviour {
//Public variables
	public bool isCorrect;
	public bool isWrong;

	//Public GameObject (Required)
	public GameObject CorrectMark;
	public GameObject WrongMark;

// Use this for initialization
	void Start () {

	}

// Update is called once per frame
	void Update () {
	}

	void OnMouseUp(){
		if(isCorrect){
			print("Right one clicked");
			Vector3 currentPositionOfQuestionBox = this.transform.parent.gameObject.transform.position;	
			

			Destroy(this.transform.parent.gameObject);
			Object.Instantiate(CorrectMark, currentPositionOfQuestionBox, Quaternion.identity);
			
		}else{
			print("Wrong one clicked");
		}
	}

	void OnMouseEnter(){
//change text color
		renderer.material.color=Color.green;
	}

	void OnMouseExit(){
//change text color
		renderer.material.color=Color.white;
	}

}
